<template>
  <div class="MockTest">
    <button @click="this.getUserInfo">获取用户信息</button>
    <button @click="this.getUserList">获取用户列表数据</button>
  </div>
</template>

<script>
import axios from "axios";
export default {
  components: {},
  data: function() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {
    //获取用户信息
    getUserInfo() {
      axios.get("/api/user/login").then(res => {
        console.log(res);
      });
    },
    //获取用户列表数据
    getUserList() {
      axios.get("/api/user/userList").then(res => {
        console.log(res);
      });
    }
  }
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
